package com.cqw.commontest.designmode.singleton;


/**
 * 跟01没区别
 */
public class Mgr02 {

    private static final Mgr02 INSTANCE;

    static {
        INSTANCE = new Mgr02();
    }

    //构造方法私有化
    private Mgr02() {

    }

    public static Mgr02 getInstance() {
        return INSTANCE;
    }

    public static void main(String[] args) {
        Mgr02 instance = Mgr02.getInstance();
        Mgr02 instance1 = Mgr02.getInstance();
        System.out.println(instance1 == instance);
    }


}
